<div class="container-fluid form-horizontal">

	<div class="col-xs-12 col-md-12 mt10">

		<style type="text/css">
			 .col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-xs-1, .col-xs-10, .col-xs-11, .col-xs-12, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9 {
				position: inherit !important;; 
			}
		</style>

		<div class="form-group">
			<label class="col-sm-2 col-xs-12 control-label">产品名称</label>
			<div class="col-sm-4 col-xs-12">
				<input type="text" class="form-control" placeholder="产品名称" ng-blur="synize()" ng-disabled=""
				 ng-model="saleobj.name">
			</div>
			<div class="col-sm-6 mt10">
				<font face="Courier" class="text-danger">此名称用于产品列表及订单名称</font>
			</div>
		</div>

		<div class="form-group">
			<label class="col-sm-2 col-xs-12 control-label">产品名称</label>
			<div class="col-sm-4 col-xs-12">
				<input type="text" class="form-control" placeholder="产品名称" ng-disabled="util.what == 'info'" ng-model="saleobj.name_inside">
			</div>
			<div class="col-sm-6 mt10">
				<font face="Courier" class="text-danger">此名称用于内部使用</font>
			</div>
		</div>

		<div class="form-group" ng-if="saleobj.code != ''">
			<label class="col-sm-2 col-xs-12 control-label">产品编码</label>
			<div class="col-sm-4 col-xs-12">
				<p class="form-control-static">{{saleobj.code}}</p>
			</div>
			<div class="col-sm-6 mt10">
				<font face="Courier" class="text-danger">产品编码</font>
			</div>
		</div>
		<div class="form-group" ng-if="saleobj.code != ''">
			<label class="col-sm-2 col-xs-12 control-label">创建运营商</label>
			<div class="col-sm-4 col-xs-12">
				<p class="form-control-static">{{saleobj.create_company_code}}</p>
			</div>
			<div class="col-sm-6 mt10">
				<font face="Courier" class="text-danger">创建本产品的运营商，其他运营商不能修改本产品</font>
			</div>
		</div>

		<div class="form-group">
			<label class="col-sm-2 col-xs-12 control-label">价格类型</label>
			<div class="col-sm-4 col-xs-12">
				<label class="radio-inline" ng-show="saleobj.address_type!='5'">
				  <input type="radio" name="price_type" ng-value="'0'"
				  ng-model="saleobj.price_type" ng-disabled="saleobj.id != ''"
				  > 有效期模式
				</label>
				<label class="radio-inline" ng-show="saleobj.address_type!='5'">
				  <input type="radio" name="price_type" ng-value="'1'"
				  ng-model="saleobj.price_type" ng-disabled="saleobj.id != ''"
				  > 价格日历模式
				</label>
				<label class="radio-inline" ng-show="saleobj.address_type=='5'">
				  <input type="radio" name="price_type" ng-value="'2'"
				  ng-model="saleobj.price_type" ng-disabled="saleobj.id != ''"
				  > 自定义规格(勿选)
				</label>
			</div>
			<div class="col-sm-6 col-xs-12">
				<p class="form-control-static text-danger">
					
				</p>
			</div>
		</div>

		<!-- <div class="form-group">
			<label class="col-sm-2 col-xs-12 control-label">产品排序</label>
			<div class="col-sm-4 col-xs-12">
				<input type="text" class="form-control" placeholder="产品排序" ng-blur="synize()" ng-model="saleobj.asort">
			</div>
			<div class="col-sm-6 mt10">
				<font face="Courier" class="text-danger">此名称用于产品列表及订单名称</font>
			</div>
		</div> -->
		<!-- ng-disabled="saleobj.id != ''" ng-change="changeCategory()" -->
		<div class="form-group">
			<label class="col-sm-2 col-xs-12 control-label">产品分类</label>
			<div class="col-sm-4  col-xs-12">
				<ui-select ng-model="saleobj.sale_category" theme="bootstrap" ng-disabled="saleobj.id != '' || util.what == 'info'">
					<ui-select-match placeholder="请选择一个销售品分类">{{$select.selected.label}}</ui-select-match>
					<ui-select-choices repeat="item.value as item in page.categorylist | filter: $select.search">
						<span ng-bind-html="item.label | highlight: $select.search"></span>
						（<span ng-bind-html="item.value | highlight: $select.search"></span>）
					</ui-select-choices>
				</ui-select>
			</div>
			<div class="col-sm-6 mt10">
				<font face="Courier" class="text-danger">产品类别</font>
			</div>
		</div>

		<div class="form-group" >
			<label class="col-sm-2 col-xs-12 control-label">显示顺序</label>
			<div class="col-sm-4 col-xs-12">
				<input type="text" class="form-control" placeholder="0" 
				 ng-model="saleobj.asort">
			</div>
			<div class="col-sm-6 mt10">
				<font face="Courier" class="text-danger">在产品列表中显示顺序</font>
			</div>
		</div>

		<div class="form-group message">
			<label class="col-sm-2 col-xs-12 control-label">短信配置</label>
			<div class="col-sm-4 col-xs-12">
			</div>
			<div class="col-sm-6 mt10">
			</div>
		</div>

		<div class="panel panel-default message">
			<div class="form-group">
				<!--<label class="col-sm-3 col-xs-12 control-label">短信发送类型</label>-->
				<label class="col-sm-2 col-xs-12 control-label">发送类型</label>
				<div class="col-sm-4 col-xs-12">
					<label class="radio-inline">
				  <input type="radio" name="sms_type" value="1"
				  ng-model="saleobj.sms_type" ng-disabled="util.what == 'info'"
				  > 发送短信
				</label>
					<label class="radio-inline">
				  <input type="radio" name="sms_type" value="0"
				  ng-model="saleobj.sms_type" ng-disabled="util.what == 'info'"
				  > 不发短信
				</label>
				</div>
				<div class="col-sm-6 mt10">
					<font face="Courier" class="text-danger">下单出票之后是否发送短信</font>
				</div>
			</div>

			<div class="form-group" ng-show="saleobj.sms_type == 1">
				<!--<label class="col-sm-3 col-xs-12 control-label">短信模板编号</label>-->
				<label class="col-sm-2 col-xs-12 control-label">模板编号</label>
				<div class="col-sm-4 col-xs-12">
					<select class="form-control" ng-model="saleobj.sms_template_id" ng-change="changeSms(saleobj)" ng-disabled="util.what == 'info'"
					 ng-options="sms.sms_template_id as sms.sms_template_id for sms in page.smslist">
	            	<option value="">  -- 空 --  </option>
	            </select>
				</div>
				<div class="col-sm-6 mt10">
					<font face="Courier" class="text-danger">发送短信内容模板</font>
				</div>
			</div>

			<div class="form-group" ng-show="saleobj.sms_type == 1">
				<!--<label class="col-sm-3 col-xs-12 control-label">短信追加内容</label>-->
				<label class="col-sm-2 col-xs-12 control-label">补充内容</label>
				<div class="col-sm-4 col-xs-12">
					<textarea class="form-control" rows="3" ng-model="saleobj.sms_diy" ng-disabled="util.what == 'info'"></textarea>
				</div>
				<div class="col-sm-6 mt10">
					<font face="Courier" class="text-danger">短信补充自定义内容</font>
				</div>
			</div>
		</div>


		<div class="form-group">
			<label class="col-sm-2 col-xs-12 control-label">对接产品</label>
			<div class="col-sm-4 col-xs-12">
				<label class="radio-inline">
					<input type="radio" name="sys_affirm_type" value="1"
					ng-model="saleobj.sys_affirm_type" ng-disabled="util.what == 'info'" 
					ng-click="saleobj.sale_belong = 'juyou'"
					> 否
				</label>
				<label class="radio-inline">
					<input type="radio" name="sys_affirm_type" value="0"
					ng-model="saleobj.sys_affirm_type" ng-disabled="util.what == 'info'" 
					ng-click="saleobj.sale_belong = ''"
					> 是
				</label>
			</div>
			<div class="col-sm-6 mt10">
				<font face="Courier" class="text-danger">对接产品是指需要到第三方系统下单的产品，请正确选择！
					<!--<br>
					需发送卡号,卡密并激活的产品,请选择需要确认-->
				</font>
			</div>
		</div>
	
		<!-- ng-disabled="saleobj.state != 0 && saleobj.id != ''" -->
		<div class="form-group mt10" >
			<label class="col-sm-2 col-xs-12 control-label">产品所属</label>
			<div class="col-sm-4 col-xs-12">
				<select class="form-control" placeholder="请选择一个产品所属" ng-model="saleobj.sale_belong" >
					<option ng-value="'juyou'" ng-show="saleobj.sys_affirm_type != '0'">自营</option>
					<option ng-repeat="item in page.salebelonglist" ng-value="item.value"  ng-show="saleobj.sys_affirm_type == '0'">{{item.label}}</option>
				</select>
				<!-- <ui-select ng-model="saleobj.sale_belong" theme="bootstrap" ng-disabled="util.what == 'info'">
					<ui-select-match placeholder="请选择一个产品所属">{{$select.selected.label}}</ui-select-match>
					<ui-select-choices repeat="item.value as item in page.salebelonglist | filter: $select.search">
						<span ng-bind-html="item.label | highlight: $select.search"></span>
					</ui-select-choices>
				</ui-select> -->
			</div>
			<div class="col-sm-6 mt10">
				<font face="Courier" class="text-danger">非自营为接口对接产品</font>
			</div>
		</div>

		<div class="form-group mt10">
			<label class="col-sm-2 col-xs-12 control-label">过期时间</label>
			<div class="col-sm-4 col-xs-12">
				<select class="form-control" ng-model="saleobj.cancel_minute">
					<option value="10">10分钟</option>
					<option value="15">15分钟</option>
					<option value="30">30分钟</option>
					<option value="60">一小时</option>
					<option value="120">两小时</option>
				</select>
			</div>
			<div class="col-sm-6 mt10">
				<font face="Courier" class="text-danger">未支付订单超时时间</font>
			</div>
		</div>


		<div class="form-group periodstart">
			<form class="form-inline">
				<label class="col-sm-2 col-xs-12 control-label">有效期始</label>
				<div class="col-sm-2">
					<div class="input-group">
						<input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" ng-model="baseinfo.dateshow.periodstart.date.label"
						 is-open="baseinfo.dateshow.periodstart.date.opened" readonly close-text="关闭" current-text="今天" clear-text="清除" />
						<span class="input-group-btn">
							<button type="button" class="btn btn-default"
									ng-click="baseinfo.dateshow.open($event, baseinfo.dateshow.periodstart.date)">
								<i class="glyphicon glyphicon-calendar"></i>
							</button>
						</span>
					</div>
				</div>
				<div class="col-xs-2">
					<select class="form-control" 
					ng-model="baseinfo.dateshow.periodstart.date.h"
					name="periodstart_h"
					>
						<option value='00'>00时</option>
						<option value='01'>01时</option>
						<option value='02'>02时</option>
						<option value='03'>03时</option>
						<option value='04'>04时</option>
						<option value='05'>05时</option>
						<option value='06'>06时</option>
						<option value='07'>07时</option>
						<option value='08'>08时</option>
						<option value='09'>09时</option>
						<option value='10'>10时</option>
						<option value='11'>11时</option>
						<option value='12'>12时</option>
						<option value='13'>13时</option>
						<option value='14'>14时</option>
						<option value='15'>15时</option>
						<option value='16'>16时</option>
						<option value='17'>17时</option>
						<option value='18'>18时</option>
						<option value='19'>19时</option>
						<option value='20'>20时</option>
						<option value='21'>21时</option>
						<option value='22'>22时</option>
						<option value='23'>23时</option>
					</select>
					&nbsp;
					<select class="form-control" 
					ng-model="baseinfo.dateshow.periodstart.date.m" 
					name="periodstart_m"
					>
						<option value='00'>00分</option>
						<option value='05'>05分</option>
						<option value='10'>10分</option>
						<option value='15'>15分</option>
						<option value='20'>20分</option>
						<option value='25'>25分</option>
						<option value='30'>30分</option>
						<option value='35'>35分</option>
						<option value='40'>40分</option>
						<option value='45'>45分</option>
						<option value='50'>50分</option>
						<option value='55'>55分</option>
						<option value='59'>59分</option>
					</select>
				</div>
		
			</form>

			
			
			<div class="col-sm-4">
				<p class="form-control-static text-danger">产品有效期开始时间</p>
			</div>
		</div>


		<div class="form-group periodend">
			<form class="form-inline">
				<label class="col-sm-2 col-xs-12 control-label">有效期止</label>
				<div class="col-sm-2">

					<div class="input-group">
						<input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" ng-model="baseinfo.dateshow.periodend.date.label"
						 is-open="baseinfo.dateshow.periodend.date.opened" readonly close-text="关闭" current-text="今天" clear-text="清除" />
						<span class="input-group-btn">
							<button type="button" class="btn btn-default"
									ng-click="baseinfo.dateshow.open($event, baseinfo.dateshow.periodend.date)">
								<i class="glyphicon glyphicon-calendar"></i>
							</button>
						</span>
					</div>
				</div>
				<div class="col-xs-2">
						<select class="form-control" 
						ng-model="baseinfo.dateshow.periodend.date.h" 
						name="periodend_h"
						>
							<option value='00'>00时</option>
							<option value='01'>01时</option>
							<option value='02'>02时</option>
							<option value='03'>03时</option>
							<option value='04'>04时</option>
							<option value='05'>05时</option>
							<option value='06'>06时</option>
							<option value='07'>07时</option>
							<option value='08'>08时</option>
							<option value='09'>09时</option>
							<option value='10'>10时</option>
							<option value='11'>11时</option>
							<option value='12'>12时</option>
							<option value='13'>13时</option>
							<option value='14'>14时</option>
							<option value='15'>15时</option>
							<option value='16'>16时</option>
							<option value='17'>17时</option>
							<option value='18'>18时</option>
							<option value='19'>19时</option>
							<option value='20'>20时</option>
							<option value='21'>21时</option>
							<option value='22'>22时</option>
							<option value='23'>23时</option>
						</select>
						&nbsp;
						<select class="form-control" 
						ng-model="baseinfo.dateshow.periodend.date.m" 
						name="periodend_m"
						>
							<option value='00'>00分</option>
							<option value='05'>05分</option>
							<option value='10'>10分</option>
							<option value='15'>15分</option>
							<option value='20'>20分</option>
							<option value='25'>25分</option>
							<option value='30'>30分</option>
							<option value='35'>35分</option>
							<option value='40'>40分</option>
							<option value='45'>45分</option>
							<option value='50'>50分</option>
							<option value='55'>55分</option>
							<option value='59'>59分</option>
						</select>
					</div>
			</form>
			
			<div class="col-sm-6">
				<p class="form-control-static text-danger">产品有效期结束时间，到时间自动下架。</p>
			</div>
		</div>


		<!-- ng-disabled="saleobj.state == '2' && !is_reloaded" -->
		<div class="form-group">
			<label class="col-sm-2 col-xs-12 control-label">统购统销产品</label>
			<div class="col-sm-4 col-xs-12">
				<label class="radio-inline">
				  <input type="radio" name="is_platform_sale" value="1"
				  ng-model="saleobj.is_platform_sale" 
				  ng-disabled="saleobj.state == '2' && !is_reloaded"
				  > 是
				</label>
				<label class="radio-inline">
				  <input type="radio" name="is_platform_sale" value="0"
				  ng-model="saleobj.is_platform_sale" 
				  ng-disabled="saleobj.state == '2' && !is_reloaded"
				  > 否
				</label>
				<a ng-if="saleobj.state == '2'" 
					class="btn btn-xs btn-success mt5" 
					style="margin-left: 10px;" 
					ng-click="reload()">初始化</a>
			</div>
			<div class="col-sm-6 mt10">
				<font face="Courier" class="text-danger">
						统购统销产品需平台审核, 可参与统购统销.
				</font>
			</div>
		</div>


		<div class="form-group" ng-if="util.what == 'edit'">
			<label class="col-sm-2 col-xs-12 control-label"></label>
			<div class="col-sm-4 col-xs-12 text-center">
				<button type="button" class="btn btn-primary btn-lg btn-block" ng-click="save()" ng-if="saleobj.id == '' || util.$modalInstance == undefined">保存</button>
				<button type="button" class="btn btn-primary btn-lg" ng-click="save()" ng-if="(saleobj.id != '') && (util.$modalInstance != undefined)">保&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;存</button>
				<button type="button" class="btn btn-primary btn-lg" ng-click="saveAndBack()" ng-if="(saleobj.id != '') && (util.$modalInstance != undefined)">保存并返回</button>
			</div>
			<div class="col-sm-4">

			</div>
		</div>

	</div>



	<div class="col-xs-12 text-center" ng-if="auditing || util.what == 'info'">
		<div class="form-group">
			<label class="col-sm-2 col-xs-12 control-label">审核意见</label>
			<div class="col-sm-8 col-xs-12">
				<textarea class="form-control" rows="3" ng-model="saleobj.apply_note" placeholder="审核意见,必填" ng-disabled="!auditing"></textarea>
			</div>
			<!--<div class="col-sm-6 mt10">
				<font face="Courier" class="text-danger"></font>
			</div>-->
		</div>
	</div>



	<div class="col-xs-12 text-center" ng-if="auditing">
		<!--<div class="col-sm-2"></div>-->
		<!--<label class="col-sm-2 col-xs-12 control-label"></label>-->
		<br/>
		<br/>
		<button class="btn btn-success" ng-click="pass()">审核&nbsp;通过</button>
		<button class="btn btn-danger" ng-click="nopass()">审核不通过</button>
		<br/>
		<br/>
		<br/>
		<br/>
	</div>


</div>